package cn.sumpu.app.guoguojie.biz;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import cn.sumpu.app.guoguojie.domain.Comment;
import cn.sumpu.app.guoguojie.domain.Family;
import cn.sumpu.app.guoguojie.domain.Member;
import cn.sumpu.app.guoguojie.exception.AppBusinessException;
import cn.sumpu.app.guoguojie.util.PageModel;

public interface FamilyBiz {
	/**
	 * 我家页面主页数据
	 * @param request
	 * @throws AppBusinessException
	 */
	public void myFamily(Integer page,HttpServletRequest request)throws AppBusinessException ;
	
	/**
	 * 我家左边数据以及session
	 * @param request
	 * @throws AppBusinessException
	 */
	public void myFamilyLeft(HttpServletRequest request)throws AppBusinessException;
	
	public void myHomeRight(HttpServletRequest request)throws AppBusinessException ;
	
	public String register(Family family, Member member)
			throws AppBusinessException;

	public Family getFamilyByDoor(String doorplate) throws AppBusinessException;
	
	public List<Family> getFamilyByNickname(String nickname) throws AppBusinessException;

	public void updateFamily(Family family) throws AppBusinessException;

	public Member register(String basePath, Family family, Member member,
			List<Member> babyList) throws AppBusinessException;

	public boolean activeMember(String memberId, String activeCode)
			throws AppBusinessException;
	
	//通过会员编号查询得到家的信息
	public Family getFamilyByMember(String member)throws AppBusinessException;
	
	//更改家庭积分
	void updateFamilyIntegral(String doorplate, Integer point, String rookieReward)throws AppBusinessException;
	
	/**
	 * author Bruce Zhang
	 * @param doorplate
	 * @param point
	 * @param isYesterday	如果是null的话则表示昨天没有登录过
	 * @throws AppBusinessException
	 */
	void updateFamilyByLogin(String doorplate, Integer point, String isYesterday)throws AppBusinessException;
	
	//根据门牌号取得这家最近的两条微博(不是同一天发的)
	List<String> getDoingTwoDay(String doorplate)throws AppBusinessException;
	
	//根据门牌号取得这家最近的两篇日志(不是同一天发的)
	List<String> getBlogTwoDay(String doorplate)throws AppBusinessException;
	
	//根据门牌号取得这家今天发表了多少条微博（包括对别人微博的评论）
	int getDoingCommentCount(String doorplate)throws AppBusinessException;
	//根据门牌号取得这家今天发表了多少篇日志（包括对别人日志的评论）
	int getBlogCommentCount(String doorplate)throws AppBusinessException;
	
	//根据门牌号取得今天这家添加了几个邻居
	int getAddFriendCount(String doorplate)throws AppBusinessException;
	//根据门牌号取得今天这家同意了几个邻居的邀请
	int getAgreeFriendCount(String doorplate)throws AppBusinessException;
	
	//根据门牌号取得这家今天微博的最高评论量
	Comment getDoingTopCommentCount(String doorplate)throws AppBusinessException;
	//根据门牌号取得这家今天日志的最高评论量
	Comment getBlogTopCommentCount(String doorplate)throws AppBusinessException;
	
	/**
	 * author Bruce Zhang
	 * @param family	家的门牌号
	 * @param content	信息内容
	 * 发送系统消息
	 * @throws AppBusinessException
	 */
	void insertSystemMessage(String family, String content) throws AppBusinessException;
	
	public Family getFamilyObjById(String family)throws AppBusinessException;
	
	public void taHomeRight(HttpServletRequest request)throws AppBusinessException;
	
	public PageModel getLoveFamilyList(Integer pageSize, Integer page)throws AppBusinessException;//查询有爱心奖章的家庭
	
	public List<String> getAllFamilyId()throws AppBusinessException;//查询所有的家庭号
}
